package libtool65.o65;

import java.io.IOException;
import java.io.InputStream;
import java.io.PrintStream;

public class ExportDefinition {
//	"global_label_name_in_asc1",0, segmentID.b, value.s
	private String name;
	int segment_id;
	int value;

	public void read(InputStream file, Mode mode) throws IOException {
		name = References.readName(file);
		segment_id = file.read();
		value = mode.readSize(file);
	}

	public void dumpInfo(PrintStream out) {
		out.println("EXPORT "+name+","+Relocation.getSegmentString(segment_id, 0)+","+value);
	}

	public String getName() {
		return name;
	}

	public int getSegmentId() {
		return segment_id;
	}

	public int getValue() {
		return value;
	}
}
